# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=py3-flask-cors
pkgver=4.0.0
pkgrel=1
pkgdesc="Cross Origin Resource Sharing (CORS) support for Flask"
url="https://github.com/corydolphin/flask-cors"
arch="noarch"
license="MIT"
depends="py3-flask py3-werkzeug"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/corydolphin/flask-cors/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/flask-cors-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4e53ab03056699f2251ba15473009a752670f69e98cd094b7de6cda3c94d917f7b4e810eb2c603c26b79f3eaa54c91c6fab9ffdf2efffd661ad0900a960aacaf  py3-flask-cors-4.0.0.tar.gz
"
